export const isLogin = JSON.parse(localStorage.getItem('isLogin')) || false

export const getUserId = () => localStorage.getItem("userid")

export const clearLoginLocalStorage = () => {
    localStorage.removeItem("isLogin")
    localStorage.removeItem("access_token")
    localStorage.removeItem("refresh_token")
    localStorage.removeItem("userid")
}

export const setLoginLocalStorage = data => {
    const {access_token, refresh_token, userid,} = data
    localStorage.setItem("isLogin", true)
    localStorage.setItem("access_token", access_token)
    localStorage.setItem("refresh_token", refresh_token)
    localStorage.setItem("userid", userid)
}
